package cc.autoapi.pucong.auto.flow.core.root.selfenum;

import com.fasterxml.jackson.annotation.JsonCreator;

public enum ParamTypeEnum implements CommonEnum<Integer> {

    输入参数(0),
    输出参数(1);

    private Integer type;

    ParamTypeEnum(Integer type){
        this.type = type;
    }

    @Override
    public String getName() {
        return this.name();
    }

    @Override
    public Integer getValue() {
        return type;
    }

    @JsonCreator
    public ParamTypeEnum getItemByValue(Integer value){
        ParamTypeEnum[] itemArr = ParamTypeEnum.values();
        if(value != null){
            for(ParamTypeEnum item : itemArr){
                if(value.equals(item.getValue())){
                    return item;
                }
            }
        }
        return null;
    }
}
